package highTech.Thread;

import java.util.Timer;
import java.util.TimerTask;

public class OutOfTime {

	public static void main(String[] args) throws Exception {
		try{
			Timer timer=new Timer();
			timer.schedule(new ThrowTask(), 1,1000);
			//Thread.sleep(1);
			//timer.schedule(new ThrowTask(), 1);
			//Thread.sleep(5000);
		}catch (Exception e) {
			e.printStackTrace();
		}
		
	}

	static class ThrowTask extends TimerTask{

		@Override
		public void run() {
			try{
				System.out.println("cccccccccccccc");
				throw new RuntimeException();
			}catch (Exception e) {
				e.printStackTrace();
			}
			
		}
		
	}
}

